home *** CD-ROM | disk | FTP | other *** search
- /****
- * CNeoIOBlock.h
- *
- * Declarations used by C++ and assembly code.
- *
- * Copyright © Neologic Systems 1992-1994. All rights reserved
- *
- ****/
-
- #ifndef __CNeoIOBlockH__
- #define __CNeoIOBlockH__ 1
-
- #include <stddef.h>
-
- // #define qNeoAsyncIO 1
-
- #include <Files.h>
-
- enum { kNeoIOBlockCount = 20};
- enum { kNeoBufferLength = 1024};
-
- class CNeoContainerStream;
-
- class CNeoIOBlock {
- public:
- CNeoIOBlock(void);
- char * getBuffer(void) {return fBuffer;}
- long getOffset(void) const {return fOffset;}
- static CNeoIOBlock *GetOne(CNeoContainerStream *aStream, const Boolean aReading);
- void release(void);
- void setOffset(const long aOffset) {fOffset = aOffset;}
-
- #if defined(qNeoPowerPC) || defined(qNeoIBMPC)
- static long SetupGlobals(const long aGlobals) {return 1;}
- #else
- static long SetupGlobals(const long aGlobals) {return SetA5(aGlobals);}
- #endif
-
- long getGlobals(void) {return fGlobals;}
- static CNeoIOBlock *GetIOBlock(NeoIOParams *aIOParams) {return (CNeoIOBlock *)((char *)aIOParams - offsetof(CNeoIOBlock, fPB));}
- ParamBlockRec * getIOPBlock(void) {return &fPB;}
- void setGlobals(const long aBase) {fGlobals = aBase;}
-
- NeoIOParams fPB;
- long fGlobals;
- Boolean fReading;
- CNeoContainerStream *
- fStream;
- long fOffset;
- char fBuffer[kNeoBufferLength];
- };
-
- // In fact, this should be a static member of CNeoIOBlock class,
- // but we cannot do that due to a bug in Borland C++ compiler.
- extern CNeoIOBlock FIOBlocks[kNeoIOBlockCount];
-
- #endif
-